<template>
  <div>文章发布</div>
  文章标题:<input v-model="form.title"></input>
  <br/>
  是否公开:   <el-switch v-model="form.status" size="small"/>
  <br/>
  内容:  <textarea name="" id="" v-model="form.content"></textarea>
  <br/>
  <el-button type="success"  @click="fn()">发布</el-button>
      <el-button type="warning" @click="">重置</el-button>
      <br/>
</template>
<script setup>
import {pushReq} from '@/api/publish';
import {reactive} from 'vue'
const form = reactive({
  title:'',
  content:'', 
  status:false,
})
function del(){
  form.title=''
  form.content=''
  form.status=''
}

//发布
function fn(){
  pushReq(form.title,form.content,form.status).then((r)=>{
    console.log(r.data);
    del()
  })
}

</script>
<style lang=""></style>
